package com.gzsxy.rabbitmq.consumer.controller;

import com.gzsxy.rabbitmq.consumer.entity.MessageIdempotent;
import com.gzsxy.rabbitmq.consumer.service.MessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @Description: 异常消息保存
 * @Author: xiaolong
 * @date: 2023/2/16 16:10
 * @Version: 1.0
 */
@Slf4j
@RequestMapping("msg")
@RestController
@Api(tags = "异常消息保存")
public class AddErrorMsgController {

    @Autowired
    private MessageService messageService;

    /**
     * 异常消息保存
     * @param message 消息
     */
    @PostMapping("add")
    @ApiOperation(value = "消息发送")
    public void addMsg(@RequestBody MessageIdempotent message) {
        messageService.addErrorMsg(message);
    }
}
